<script setup>
import { useRouter } from 'vue-router';

// 在外面实例化下，箭头函数访问不到useRouter
const router = useRouter(); 
setTimeout(() => {
    router.push('/Home')
}, 3000);
</script>

<template>
    <h2>
        {{ $route.path }} 404 NotFound
    </h2>
</template>

<style>
h2 {
    color: red;
}
</style>